package com.beetl.ext.fn;

public class StringUtil {
	// 首字母大写转换
	public String capitalize(String str) {
		if (str == null)
			throw new NullPointerException("Error:toUpperCase(null)");
		return str.substring(0, 1).toUpperCase() + str.substring(1);
	}

	// 首字母小写转换
	public String uncapitalize(String str) {
		if (str == null)
			throw new NullPointerException("Error:toUpperCase(null)");
		return str.substring(0, 1).toLowerCase() + str.substring(1);
	}

	public static void main(String[] args){
		StringUtil su = new StringUtil();
		System.out.println(su.capitalize("address"));
		System.out.println(su.uncapitalize("address"));
	}
}
